Count-distinct problem